<include file="Public/min-header"/>
<div class="wrapper"> 
  <include file="Public/breadcrumb"/>
  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
        <div class="pull-right">
            <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
        </div>
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 商品规格({$name})</h3>
        </div>
        <div class="panel-body">
          <div class="navbar navbar-default">
              <form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
                <div class="form-group"  style="display: none">
                    <select name="cat_id1" id="cat_id1" class="form-control" style="width:250px;margin-left:-15px;">
                        <option value="">所有分类</option>
                        <foreach name="cat_list" item="v" >                                            
                            <option value="{$v['cat_id']}">{$v['cat_name']}</option>
                        </foreach>                                            
                    </select>                    
                </div>
                <div class="form-group"  style="display: none">
	                <button type="submit" onclick="ajax_get_table('search-form2',1)" id="button-filter" class="btn btn-primary pull-right">
	                 <i class="fa fa-search"></i> 筛选
	                </button>
                </div> 
				
                <button type="submit" onclick="location.href='{:U('Seller/GoodsTianxin/addEditSpec',array('goods_type_id'=>$goods_type_id))}'" id="button-filter" class="btn btn-primary pull-right">
                 <i class="fa fa-plus"></i> 添加规格内容
                </button><div style="width: 100%;text-align:right;"> （如：款式，颜色，包装..）</div>
              </form>

          </div>
          <div id="ajax_return"> </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
<script>
    $(document).ready(function(){		
		<?php
		    if($_GET['type_id'])
			{
			   echo "$('#type_id').val(".$_GET['type_id'].");"; 
			}
		?>
			$('#button-filter').trigger('click');
    });

    // ajax 抓取页面 form 为表单id  page 为当前第几页
    function ajax_get_table(form,page){
		cur_page = page; //当前页面 保存为全局变量
            $.ajax({
                type : "POST",
                url:"/index.php?m=Seller&c=GoodsTianxin&a=ajaxSpecList&goods_type_id="+{$goods_type_id}+"&p="+page,//+tab,
                data : $('#'+form).serialize(),// 你的formid
                success: function(data){
                    $("#ajax_return").html('');
                    $("#ajax_return").append(data);
                }
            });
        }			 	
	 
</script> 
</body>
</html>